//标签相关接口
import request from '@/utils/request'
import type {
  DeleteRequest,
  Permission,
  PermissionAddRequest,
  PermissionUpdateRequest,
} from './type'
//项目用户相关的请求地址
enum API {
  GET_ALL_URL = '/permission/all',
  DELETE_URL = '/permission/delete',
  ADD_URL = '/permission/add',
  UPDATE_URL = '/permission/update',
}

//获取标签列表接口
export const reqGetAll = () => request.get<any, any>(API.GET_ALL_URL)

//删除标签接口
export const reqDelete = (data: DeleteRequest) =>
  request.post<any, any>(API.DELETE_URL, data)

//新增标签接口
export const reqAdd = (data: PermissionAddRequest) =>
  request.post<any, any>(API.ADD_URL, data)

//修改标签接口
export const reqUpdate = (data: PermissionUpdateRequest) =>
  request.post<any, any>(API.UPDATE_URL, data)
